package com.zg.datapush.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zg.common.core.vo.BaseEntityVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 推送记录VO（增强版）
 * @author zg
 */
@Data
@ApiModel("推送记录")
public class DpPushRecordVo extends BaseEntityVo {

    @ApiModelProperty("任务ID")
    private Long taskId;

    @ApiModelProperty("任务名称")
    private String taskName;

    @ApiModelProperty("目标系统名称")
    private String targetSystem;

    @ApiModelProperty("单据类型")
    private String documentType;

    @ApiModelProperty("推送方式")
    private String pushMethod;

    @ApiModelProperty("推送模式")
    private String pushMode;

    @ApiModelProperty("触发类型")
    private String triggerType;

    @ApiModelProperty("业务主键")
    private String businessKey;

    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date endTime;

    @ApiModelProperty("执行耗时（毫秒）")
    private Long duration;

    @ApiModelProperty("执行状态")
    private String status;

    @ApiModelProperty("总记录数")
    private Integer totalCount;

    @ApiModelProperty("成功推送数")
    private Integer successCount;

    @ApiModelProperty("失败推送数")
    private Integer failedCount;

    @ApiModelProperty("错误信息")
    private String errorMessage;

    @ApiModelProperty("重试次数")
    private Integer retryCount;

    @ApiModelProperty("父记录ID")
    private Long parentRecordId;

    @ApiModelProperty("推送日志详情")
    private List<DpPushLogVo> pushLogs;

    // ========== 查询条件字段 ==========
    @ApiModelProperty("开始时间-查询开始")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date startTimeBegin;

    @ApiModelProperty("开始时间-查询结束")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", shape = JsonFormat.Shape.STRING, timezone = "GMT+8")
    private Date startTimeEnd;
}
